#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFile>


namespace Ui {
class MainWindow;
}

class QFile;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

protected:
    void dragEnterEvent(QDragEnterEvent *event);
    void dropEvent(QDropEvent *event);
private slots:
    void markSlots();
    void continueReadSlots();

    void recvArgs(int lineSize, int groupSize);
private:
    Ui::MainWindow *ui;
    QFile m_file;
    quint64 m_pos;
    QString m_groupString;
    QString m_asciiString;


    ///控制参数
    quint32 m_groupSize;
    quint32 m_lineSize;

    ///界面初始化
    void setUpColorComBox();
    void setTextEdit();
    void setLableColor(QString colorName);

    void setUpActions();
    void setupFileActions();
    void setupEditActions();
    void setCtrlActions();

    void setupSpinBox();

    ///业务逻辑
    bool openFile(QString fileName);
    void readFile();
    QString groupingString(const char * srcStr, int len, int step);
    QString asciiFormatString(QByteArray &array);
};

#endif // MAINWINDOW_H
